#include "PoissonState.h"

using namespace ompl;

namespace poisson
{

PoissonState::PoissonState(const base::SpaceInformation *si, const base::State* state, int id, int level)
: state_(si->allocState()), si_(si), id_(id), level_(level), isTreeNode_(false)
{
	si->copyState(state_, state);
}

PoissonState::~PoissonState()
{
	si_->freeState(state_);
}

void PoissonState::convertToGPUState(GPUPoissonState& gpuState)
{
	si_->getStateSpace()->serialize(gpuState.value_, state_);
	gpuState.id_ = id_;
	gpuState.level_ = level_;
	gpuState.isTreeNode_ = isTreeNode_;
}

}